<?php

  abstract class NumberCategory extends Category
  {
    public function __construct($name, Dice $dice)
    {
      parent::__construct($name);
      
      $filteredDice = array_filter($dice->getValues(), array($this, "check"));
      $this->score = array_sum($filteredDice);
    }
    
    abstract protected function getNumber();
    
    protected function check($num)
    {
      if ($num == $this->getNumber()) {
        return true;
      } else {
        return false;
      }
    }
  }

?>